#define _CRT_SECURE_NO_WARNINGS 1
#include <iostream>
#include <vector>
#include <list>
#include "stack.h"
#include "queue.h"
#include "priority_queue.h"
using namespace std;

//stack
void test1()
{
	cout << "-------stack-------" << endl;
	mystack::stack<int,vector<int>> st;
	st.push(1);
	st.push(2);
	st.push(3);
	st.push(4);
	cout << st.size() << endl;
	while (!st.empty())
	{
		cout << st.top() << " ";
		st.pop();
	}
	cout << endl;
}
void test2()
{
	cout << "-------queue-------" << endl;
	myqueue::queue<int, vector<int>> q;
	q.push(1);
	q.push(2);
	q.push(3);
	q.push(4);
	cout << q.size() << endl;
	while (!q.empty())
	{
		cout << "front " << q.front() << " back " << q.back() << endl;
		q.pop();
	}
	cout << endl;
}
void test3()
{
	cout << "---priority_queue---" << endl;
	deque<int> v;
	v.push_back(4);
	v.push_back(1);
	v.push_back(3);
	v.push_back(4);
	v.push_back(3);
	v.push_back(2);
	v.push_back(3);
	v.push_back(5);
	mypriority_queue::priority_queue<int, deque<int>, greater<int>> pq(v.begin(), v.end());
	while (!pq.empty())
	{
		cout << pq.top() << " ";
		pq.pop();
	}
	cout << endl;
	pq.push(4);
	pq.push(10);
	pq.push(2);
	pq.push(5);
	while (!pq.empty())
	{
		cout << pq.top() << " ";
		pq.pop();
	}
	cout << endl;
}
int main()
{
	test1();
	test2();
	test3();
	return 0;
}